#!/bin/sh

set -e

# Identify the user installing the package
USER=$(stat -f%Su /dev/console)

# Load the LaunchAgent for the user
launchctl bootstrap gui/$(id -u "$USER") "/Library/LaunchAgents/com.duplicati.app.launchagent.plist"
launchctl enable gui/$(id -u "$USER")/com.duplicati.app.launchagent
exit 0
